import request from '@/utils/request'

export const getList = (data: any, page: number, limit: number) =>
  request({
    url: `/api/customer/list?page=${page}&limit=${limit}`,
    method: 'post',
    data
  })

export const setAttention = (data: any) =>
  request({
    url: '/api/customer/setAttention',
    method: 'post',
    data
  })

export const setIsIntention = (data: any) =>
  request({
    url: '/api/customer/setIsIntention',
    method: 'post',
    data
  })
export const SetIsPrivate = (data: any) =>
  request({
    url: '/api/customer/setIsPrivate',
    method: 'post',
    data
  })

export const setDealStatus = (data: any) =>
  request({
    url: '/api/customer/setDealStatus',
    method: 'post',
    data
  })

export const setGroupCollect = (data: any) =>
  request({
    url: '/api/customer/setCustomerGroup',
    method: 'post',
    data
  })
export const setSourceCollect = (data: any) =>
  request({
    url: '/api/customer/setCustomerSource',
    method: 'post',
    data
  })

export const setLabelCollect = (data: any) =>
  request({
    url: '/api/customer/setCustomerLabel',
    method: 'post',
    data
  })

export const getLog = (id: number) =>
  request({
    url: `/api/customer/log/${id}`,
    method: 'get',
  })
export const createCustomer = (data: any) =>
  request({
    url: '/api/customer/create',
    method: 'post',
    data
  })

export const updateCustomer = (id: number, data: any) =>
  request({
    url: `/api/customer/${id}`,
    method: 'put',
    data
  })

export const getCustomer = (id: number) =>
  request({
    url: `/api/customer/${id}`,
    method: 'get',
  })
export const getCustomerAllIds = (data: any) =>
  request({
    url: `/api/customer/getAllIds`,
    method: 'post',
    data
  })
export const getCustomerIds = (data: any) =>
  request({
    url: '/api/customer/getIds',
    method: 'post',
    data
  })

export const deleteCustomer = (id: number) =>
  request({
    url: `/api/customer/${id}`,
    method: 'delete'
  })
